<html>

<body>
    <script>
        // var websocket = new WebSocket("wss://ws.tdreamer.cc:443", 'something');
        //var websocket = new WebSocket("wss://localhost:443");
        var websocket = new WebSocket("ws://localhost:3030");
        websocket.onopen = function (evt) {
            onOpen(evt)
        };
        websocket.onclose = function (evt) {
            onClose(evt)
        };
        websocket.onmessage = function (evt) {
            onMessage(evt)
        };
        websocket.onerror = function (evt) {
            onError(evt)
        };

        function onOpen(evt) {
            console.log("Connected to WebSocket server.");
             websocket.send("client test");
             websocket.send("client test1");
             websocket.send("client test2");
        }

        function onClose(evt) {
            console.log("Disconnected");
        }

        function onMessage(evt) {
            console.log('Retrieved data from server: ' + evt.data);
        }

        function onError(evt) {
            console.log('Error occured: ' + evt.data);
        }
       
    </script>
</body>

</html>